import { ObjCreate } from "../../ObjCreate";
import { ImagesConst } from "../../../../resource/ImagesConst";
import { ItemConfig } from "../../../../resource/ItemConfig";
import { RuneUtil } from "../../../skill/rune/RuneUtil";
import { ItemData } from "../../../../resource/info/ItemData";
import { Language } from "../../../../../../extend/language/Language";
import { FilterConst } from "../../../../../component/gconst/FilterConst";
import { GTextFiled } from "../../../../../../com/mui/controls/GTextFiled";
type int = number;
//class RuneSWallowedEffect
    
    export  class RuneSWallowedEffect /* flash.display.Sprite */
    {
        constructor()
        {
            
            ObjCreate.createBg(0, 0, 190, 1, this, ImagesConst.SplitLine);
            this.line = ObjCreate.createBg(0, 0, 190, 1, this, ImagesConst.SplitLine);
            this.txt = ObjCreate.createGTextField("", 0, this.TxtStartY, 190, 100, this);
            var loc1=this.txt.defaultTextFormat;
            loc1.leading = this.TxtLeading;
            this.txt.defaultTextFormat = loc1;
            this.txt.multiline = true;
            this.txt.wordWrap = true;
            return;
        }

        public /* override */ get height(): number
        {
            return this.TxtStartY + (this.txt.numLines - 1) * 12 + (this.txt.numLines - 1) * this.TxtLeading;
        }

        public setData(arg1: int, arg2: Boolean=false): void
        {
            var loc1=ItemConfig.instance.getInfoByCode(arg1);
            if (loc1 == null) 
            {
                this.txt.htmlText = "";
                return;
            }
            var loc2=loc1.htmlName;
            var loc3=RuneUtil.getRuneItemDesc(new ItemData(arg1));
            if (arg2) 
            {
                this.txt.htmlText = Language.getStringByParam(80093, loc2, loc3);
                this.txt.filters = [FilterConst.glowFilter];
            }
            else 
            {
                this.txt.htmlText = loc2 + " " + Language.getString(80325) + "\n" + loc3;
                this.txt.filters = [FilterConst.colorFilter];
            }
            this.line.y = this.height;
            return;
        }

        /* internal  */static get txtTry(): Object /* flash.text.TextField */
        {
            if (RuneSWallowedEffect._txtTry == null) 
            {
                RuneSWallowedEffect._txtTry = new Object /* flash.text.TextField */();
            }
            return RuneSWallowedEffect._txtTry;
        }

        public /* const */TxtStartY: int=5;

        public /* const */TxtLeading: int=4;

        public /* var */txt: GTextFiled;

        public /* var */line: Object /* flash.display.Bitmap */;

        /* internal */ static /* var */_txtTry: Object /* flash.text.TextField */;
    }
